Add API that allows reading many points #68
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds to the API of the reader some functions
that allows to read many points in one call.
There are few variants, depending on how the user wants to be conservative with allocations.
Also ideally, there would be a
read_into(&mut self, buf: &mut [Point]) -> Result<u64>
In order to avoid more allocations (especially the potential extra bytes), but for that there needs to exist aPoint::read_into(raw: &RawPoint, dest_point: &mut Point)
or similar. Which could be added later.The main point for these methods, is that it will later allow to make use of laz-rs parrallel decompressor to greatly speed-up reading LAZ files.
If needed, we could add later an iterator that returns vecs of points e.g: